<template>
  <div id="">
    <h2>{{ name }}</h2>
    <h2>{{name2}}</h2>
  </div>
</template>


<script setup lang="ts">
import { computed, ref } from 'vue'
let firstName = ref('Zhyang')
let lastName = ref('Yang')
// 计算属性
const name = computed(() => {
  return firstName.value + '-' + lastName.value
})
// 也可以通过第二种方式
const name2 = computed({
  get() {
    return firstName.value + lastName.value
  },
  set() {
    firstName.value + lastName.value
  }
})
</script>

<style lang="less">
</style>
